package com.molichuxing.gateway.bff.user.convertor;

import org.springframework.beans.BeanUtils;

import com.molichuxing.framework.utils.DateUtil;
import com.molichuxing.gateway.bff.user.entity.response.UserVo;
import com.molichuxing.services.business.dto.response.UserDetailBizDto;

/**
 * 
 * @author liyg
 * 数据转换类
 * 2019-08-16
 *
 */
public class Convert {
	
	public static UserVo toUserVo(UserDetailBizDto userDetailBizDto) {
		if (userDetailBizDto == null) {
			return null;
		}

		UserVo userVo = new UserVo();
		BeanUtils.copyProperties(userDetailBizDto, userVo);
		userVo.setUserId(userDetailBizDto.getId());
		userVo.setRegtime(DateUtil.formatTime(userDetailBizDto.getRegtime()));

		return userVo;
	}
}
